<template>
    <div class="div">
        &nbsp;&nbsp;检测条件
    </div>
    <table id="norm" cellspacing="1" style="width: 100%;height: 250px;border: 1px solid #a8aeb2;">
        <tr class="tr" v-for="norms in labRecordNormList">
            <th v-for="norm in norms.itemsRecordNormList"
                :class="{ 'thE': norm.fieldInput === '0', 'thF': norm.fieldInput === '1' }"
                :rowspan="norm.fieldRowspan > 0 ? norm.fieldRowspan : 1"
                :colspan="norm.fieldColspan > 0 ? norm.fieldColspan : 1">
                <span v-if="norm.fieldInput === '0'">{{ norm.fieldName }}</span>
                <a-textarea v-else-if="norm.fieldInput === '1'" v-model:value="norm.fieldValue" size="large" class="input" />
            </th>
        </tr>
    </table>
</template>
  
<script lang="ts" setup>

const props = defineProps<{
    labRecordNormList?: [{
        nId: String | number,
        itemsRecordNormList: [{
            id: String | number,
            createBy: String,
            createTime: String,
            updateBy: String,
            updateTime: String,
            sysOrgCode: String,
            taskId: String,
            itemId: String,
            fieldName: String,
            fieldCode: String,
            fieldValue: String,
            fieldInput: String | number,
            fieldOption: String | number,
            fieldSort: number,
            fieldType: String,
            fieldRow: number,
            fieldCol: number,
            fieldRowspan: number,
            fieldColspan: number,
        }]
    }],
}>();

defineExpose({
    props,
});

</script>
  
<style scoped>
.tr {
    height: 50px;
    border: 1px solid #a8aeb2;
}

.div{
    height: 45px; 
    border: 1px solid #a8aeb2;
    background-color: #d2d5d6;
    text-align: left;
    font: 1.2em sans-serif;
    line-height:45px
}
.thE {
    width: 25%;
    text-align: center;
    border: 1px solid #a8aeb2;
    font: 1.2em sans-serif;
}

.thF {
    text-align: center;
    border: 1px solid #a8aeb2;
    font: 1.2em sans-serif;
}

.input {
    width: 100%;
    height: 100%;
    border: none;
    background-color: inherit;
    outline: none;
    border-bottom: none;
    display: block;
}
</style>